package com.superfeng.cloud.controller;

import com.superfeng.cloud.entity.Dept;
import com.superfeng.cloud.service.DeptService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/dept")
public class DeptController {
    @Resource
    private DeptService deptService;

    @GetMapping("/getDeptId/{deptNo}")
    public Dept getDeptId(@PathVariable("deptNo") Long deptNo) {
        return deptService.getDeptId(deptNo);
    }

    @GetMapping("/getList")
    public List<Dept> getList() {
        return deptService.getList();
    }
}
